﻿#include "SList.h"

void TestSList1()
{
	SLTNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	SListPrint(plist);

	SListPushFront(&plist, -1);
	SListPushFront(&plist, -2);
	SListPushFront(&plist, -3);
	SListPrint(plist);

	SListPopBack(&plist);
	SListPopBack(&plist);
	SListPopBack(&plist);
	SListPrint(plist);

	SLTNode* pos = SListFind(plist, 1);
	SListInsertAfter(pos, 30);
	SListPrint(plist);

	SListEraseAfter(pos);
	SListPrint(plist);

	SListInsertBefore(&plist, pos, 50);
	SListPrint(plist);

	SListEraseCur(&plist, pos);
	SListPrint(plist);

	SLTNode* pos1 = SListFind(plist, 50);
	SListEraseCur(&plist, pos1);
	SListPrint(plist);
}

int main()
{
	TestSList1();
	return 0;
}